import java.util.Scanner;

public class Text2 {
    public static void hanNuoTa(int n,char pose1,char pose2,char pose3){
        if(n==1){
            move(pose1,pose3);
            return;
        }
        hanNuoTa(n-1,pose1,pose3,pose2);
        move(pose1,pose3);
        hanNuoTa(n-1,pose2,pose1,pose3);

    }
    public static void move(char pose1,char pose2){
        System.out.println(pose1+"--->"+pose2);
    }

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入盘子的个数");
        while(sc.hasNextInt()) {
            int n = sc.nextInt();
            hanNuoTa(n, 'A', 'B', 'C');
        }
    }
}
